home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.2r / card_19418.txt < prev    next >
Text File  |  1989-02-26  |  3KB  |  102 lines

  1. -- card: 19418 from stack: in.2r
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 13187
  5. -- name: ART HyperText Trick
  6. ----- HyperTalk script -----
  7. on closecard
  8.   put empty into card field theword
  9.   pass closecard
  10. end closecard
  11.  
  12.  
  13.  
  14. -- part 1 (field)
  15. -- low flags: 01
  16. -- high flags: 0000
  17. -- rect: left=60 top=307 right=325 bottom=224
  18. -- title width / last selected line: 0
  19. -- icon id / first selected line: 0 / 0
  20. -- text alignment: 0
  21. -- font id: 3
  22. -- text size: 12
  23. -- style flags: 0
  24. -- line height: 16
  25. -- part name: theWord
  26.  
  27.  
  28. -- part 2 (field)
  29. -- low flags: 00
  30. -- high flags: 4007
  31. -- rect: left=57 top=70 right=299 bottom=491
  32. -- title width / last selected line: 0
  33. -- icon id / first selected line: 0 / 0
  34. -- text alignment: 0
  35. -- font id: 3
  36. -- text size: 9
  37. -- style flags: 0
  38. -- line height: 12
  39. -- part name: description
  40. ----- HyperTalk script -----
  41. on mousewithin
  42.   --
  43.   --hypertext technique by Steve Drazga, ART Incorporated
  44.   --if you use this in your scripts please include these 2 lines.
  45.   --
  46.   if the locktext of the target is true then   --unlock the field if
  47.     set locktext of target to false            --it is locked.
  48.   end if
  49.  
  50.   if selection is not empty then  --something was selected
  51.     put selection into SelectedWord
  52.     if space is in SelectedWord then  --the user selected more than 1 word
  53.       click at loc of target       --so we will clear the selection
  54.       exit mousewithin             --and exit to wait for another selection
  55.     end if
  56.  
  57.     put selectedWord into card field theWord
  58.  
  59.   end if
  60. end mousewithin
  61.  
  62.  
  63. -- part contents for background part 4
  64. ----- text -----
  65. 2
  66.  
  67. -- part contents for background part 2
  68. ----- text -----
  69. HyperText Trick
  70.  
  71. -- part contents for card part 2
  72. ----- text -----
  73. --DOUBLE CLICK on any word in this field for an example
  74. --
  75. --This trick lets the user double click on a word to activate a hypertext link.
  76. --The 'on mousewithin' script goes into the target field.
  77. --Look at the script of the 'syntax' fields on the XCMD or XFCN card for a
  78. --varation of this method.
  79.  
  80.  
  81. on mousewithin
  82.   --
  83.   --hypertext technique by Steve Drazga, AnalytX
  84.   --if you use this in your scripts please include these 2 lines.
  85.   --
  86.     if the locktext of the target is true then    
  87.       set locktext of target to false          --unlock the field if it is locked
  88.    end if
  89.  
  90.    if selection is not empty then             --something was selected
  91.       put selection into SelectedWord
  92.       if space is in SelectedWord then      --the user selected more than 1 word
  93.          click at loc of target                    --so we will clear the selection
  94.          exit mousewithin                         --and exit to wait for another selection
  95.       end if
  96.     --
  97.     --this is the section where you do something with the selection
  98.     --You can bring up a pop up note or you can go to another card.  
  99.     --
  100.     end if
  101. end mousewithin
  102.